package com;

import com.sun.spot.resources.transducers.LEDColor;

public class Utility {
	
	
	
	public static long memoryUsage(int ledIndex) {
		long memory = Runtime.getRuntime().freeMemory();
		
		if (memory < 100000) 
			LedsManager.ledON(ledIndex, LEDColor.RED);
		else if (memory < 200000)
			LedsManager.ledON(ledIndex, LEDColor.BLUE);
		else if (memory < 300000)
			LedsManager.ledON(ledIndex, LEDColor.YELLOW);
		else if (memory < 400000)
			LedsManager.ledON(ledIndex, LEDColor.GREEN);
		else if (memory < 500000)
			LedsManager.ledON(ledIndex, LEDColor.WHITE);		
		return memory;
	}
}
